Skip to content

Fix credentials request option written to init.mode instead of init.credentials#171

Merged
mnot merged 1 commit into
mainfrom
fix/credentials-init-option
Jun 9, 2026
Merged

Fix credentials request option written to init.mode instead of init.credentials#171
mnot merged 1 commit into
mainfrom
fix/credentials-init-option

Conversation

@mnot

@mnot mnot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator

Fixes the latent bug in #165: the credentials request option was assigned to init.mode in test-engine/client/fetching.mjs, clobbering mode and never reaching fetch(). Now assigned to init.credentials.

No current test sets credentials, but the test-suite schema defines it, so this prevents the first such test from silently misbehaving.

Closes #165


🤖 This PR was generated by an AI agent (Claude Code) under human supervision, as part of a maintainer-directed review of the test suite.

The credentials value was assigned to init.mode, clobbering the mode
option and never reaching fetch(). Assign it to init.credentials.

Closes #165

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@mnot

mnot commented Jun 9, 2026

Copy link
Copy Markdown
Collaborator Author

LGTM. Verified against the source: the diff is exactly the intended one-line change at test-engine/client/fetching.mjs:26, swapping init.mode = reqConfig.credentials for init.credentials = reqConfig.credentials.

  • Correctness: init.credentials is the right fetch() init key, and the schema (test-engine/lib/testsuite-schema.json:109-113) constrains the value to the valid enum omit / same-origin / include, so the value passed through maps directly onto Fetch's credentials option.
  • No regression to mode: line 25 (if ('mode' in reqConfig) init.mode = reqConfig.mode) is untouched, and since the old line overwrote init.mode, this fix actually restores mode handling for any request that also set credentials. The surrounding option assembly (cache, redirect, headers) is unaffected and remains consistent.
  • Latent-fix characterization is accurate: grep -rc credentials tests/ returns no matches, so no current test exercises this path — nothing changes for the existing suite, and the first test to set credentials will now behave correctly. The explain-test.liquid template already documents credentials separately, so docs and behavior are now aligned.

No side effects spotted. Ship it.


This is an AI-generated review (Claude Code), posted as part of a maintainer-directed review of the test suite.

@mnot mnot merged commit 258c65f into main Jun 9, 2026
2 checks passed
@mnot mnot deleted the fix/credentials-init-option branch June 9, 2026 04:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

credentials request option written to init.mode instead of init.credentials

1 participant